/*
 * @Author: 王朋坤
 * @Date: 2021-08-25 16:58:04
 * @LastEditTime: 2021-09-09 14:54:10
 * @LastEditors: Please set LastEditors
 * @Description: cesium初始化
 * @FilePath: /index/src/ys/cesium/initCesium.js
 */
import * as Cesium from "cesium";
export default function initCesium(containerId, defaultCesiumConifg) {
  // 默认配置
  Cesium.Ion.defaultAccessToken =
    "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxODE0MjNlMy01OWQ1LTQwYTQtOWIwZC1jNWMyMDhkZGJiM2QiLCJpZCI6NjQwMjksImlhdCI6MTYyODc1MTkyOX0.8WVQu75c6Hkgol73H_n9oegZDkQfXwXTWNI3dfsusiI";
  const viewer = new Cesium.Viewer(containerId, defaultCesiumConifg);
  viewer._cesiumWidget._creditContainer.style.display = "none";
  viewer.scene.globe.enableLighting = false;
  // viewer.camera.flyTo({
  //   destination: Cesium.Cartesian3.fromDegrees(
  //     110.763181,31.341172,120.0
  //   ),
  // });
  return viewer;
}